package com.harassment.interception.data.databases.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;


import com.harassment.interception.data.databases.entities.BlackList;

import java.util.List;

@Dao
public interface BlackListDao {
    @Insert
    void addBlackList(BlackList... blackLists);

    @Delete
    void deleteBlackList(BlackList... blackLists);

    @Update
    void updateBlackList(BlackList... blackLists);

    @Query("select * from black_list order by id desc")
    List<BlackList> getAllBlackList();

    @Query("select * from black_list where number = :number")
    BlackList getBlackListForNumber(String number);

    @Query("select * from black_list where model = :model order by id desc")
    List<BlackList> getBlackListForModel(int model);

}
